package Demo3;

public class Animal2 {
    private String name;

    public Animal2(String name) {
        this.name = name;
    }

    class Frog {
        private int age;

        public Frog(int age) {
            this.age = age;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        @Override
        public String toString() {
            return "Frog{" +
                    "age=" + age +
                    '}';
        }
    }
}
